
import java.io.File;
import java.io.FileNotFoundException;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
import java.util.logging.Level;
import java.util.logging.Logger;

/*
 * Implemetenacion del Insertion_Sort
 * http://stackoverflow.com/questions/5346500/sorting-an-arraylist-of-objects-using-insertion-sort
 */
public class Insertion_Sort {

    

    
 
    
    
    
    
    public static void insertionSort(ArrayList<Integer> list)
 {//selection sort
  int tempStudent;
  int count1;
  int count2;
  int largest;

  for (count1=0; count1<list.size()-1; count1++)
  {
   largest = 0;
   for (count2=largest+1; count2<list.size()-count1; count2++)
   {
    if ((list.get(largest)).compareTo(list.get(count2)) < 0)
    {
     largest = count2;
    }
   }
   tempStudent = list.get(list.size()-1-count1);
   list.set(list.size()-1-count1, list.get(largest));
   list.set(largest, tempStudent);
  }
 }


}
